import matplotlib.pyplot as plt
import numpy as np

plt.figure(figsize=(20,20), dpi=80)

plt.subplot(2,2,1)

X = np.linspace(-np.pi, np.pi, 256, endpoint=True)
C, S = np.cos(X), np.sin(X)

ax = plt.gca()
ax.spines['right'].set_color('none')
ax.spines['top'].set_color('none')
ax.xaxis.set_ticks_position('bottom')
ax.spines['bottom'].set_position(('data',0))
ax.yaxis.set_ticks_position('left')
ax.spines['left'].set_position(('data',0))


plt.plot(X, C, color='blue', linewidth=1.0, linestyle='-', label="cosine")
plt.plot(X, S, color='green', linewidth=1.0, linestyle="-", label="sine")
plt.legend(loc='upper left')
plt.xlim(-4.0, 4.0)
plt.xticks(np.linspace(-4, 4, 9, endpoint=True))

plt.ylim(-1.0, 1.0)
plt.yticks(np.linspace(-1, 1, 5, endpoint=True))




plt.savefig("./sandc.png", dpi=72)

plt.show()